hackerrank print in reverse problem solution

visit shbcf.ru